package com.ruoyi.system.ali;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component
public class ChannelUtil {
    private Map<String, ChannelService> map = new HashMap<>();

    public ChannelUtil(List<ChannelService> channelServiceList) {
        for (int i = 0; i < channelServiceList.size(); i++) {
            ChannelService orderChannelService = channelServiceList.get(i);
            map.put(orderChannelService.getType(), orderChannelService);
        }
    }

    public ChannelService getChannelService(String type) {
        return map.get(type);
    }


}
